<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDemosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('demos', function (Blueprint $table) {
            $table->increments('id')->comment('ID');
            $table->char('input', 50)->nullable()->comment('文本域');
            $table->text('dynamic_input')->nullable()->comment('动态文本域');
            $table->text('textarea')->nullable()->comment('多行文本域');
            $table->text('dynamic_textarea')->nullable()->comment('动态多行文本域');
            $table->string('single_file', 500)->nullable()->comment('单文件上传');
            $table->text('multiple_file')->nullable()->comment('多文件上传');
            $table->string('single_box')->nullable()->comment('单选框');
            $table->string('multiple_box', 500)->nullable()->comment('多选框');
            $table->string('single_select')->nullable()->comment('单选下拉');
            $table->string('multiple_select', 500)->nullable()->comment('多选下拉');
            $table->string('transfer', 500)->nullable()->comment('穿梭框');
            $table->string('select_tree')->nullable()->comment('树状下拉选择');
            $table->string('cascader')->nullable()->comment('级联选择');
            $table->text('editor')->nullable()->comment('编辑器');
            $table->dateTime('date')->nullable()->comment('日期选择器');
            $table->char('time', 5)->nullable()->comment('时间选择器');
            $table->dateTime('datetime')->nullable()->comment('日期时间选择器');
            $table->string('password')->nullable()->comment('密码框');
            $table->char('other', 50)->nullable()->comment('其他');
            $table->dateTime('created_at')->nullable()->comment('创建时间');
            $table->dateTime('updated_at')->nullable()->comment('修改时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('demos');
    }
}
